package com.patternsbox.creational.singleton;

class Singleton {
	private static Singleton instance;

	private Singleton() {
	}

	public static Singleton getInstance() {
		// Uses lazy initialization.
		// Note: this is not thread safe.
		if (instance == null) {
			instance = new Singleton();
		}
		return instance;
	}
}
